import Joi from '@hapi/joi';

export const baseRule = {
  params: {
    id: Joi.string().required(),
  },
};

export const indexRule = {
  query: {
    page: Joi.number()
      .integer()
      .min(1)
      .default(1),
    pageSize: Joi.number()
      .integer()
      .min(10)
      .max(100)
      .default(10),
    user_id: Joi.string()
      .required()
  },
};


export const createRule = {
  body: {
    user_id: Joi.string()
      .required(),
    content: Joi.string()
      .required()
  },
};

export const updateRule = {
  body: {
    ...createRule.body,
    id: Joi.number()
      .required()
  }
}